/*
 * Knight.cpp
 *
 *  Created on: Mar 6, 2011
 *      Author: Michael Ziminsky
 */

#include "Knight.h"

namespace model
{
	namespace piece
	{
		Knight::Knight(bool light) : ChessPiece(light) {}

		myTypes::moveSet Knight::getPotentialMoves(const ChessBoard& b) const
		{
			myTypes::moveSet moves(new myTypes::moveSet::element_type);
			if (currLoc)
				for (int d = LEFTUP; d != LEFTDOWN; d++)
				{
					cellCheck(b, getOffsetLocation(static_cast<Direction>(d), *currLoc, 2, 1), moves);
					cellCheck(b, getOffsetLocation(static_cast<Direction>(d), *currLoc, 1, 2), moves);
				}
			return moves;
		}
	} // namespace pieces
} // namespace model
